/*******************************************************************************
  Main Source File

  Company:
    Microchip Technology Inc.

  File Name:
    main.c

  Summary:
    This file contains the "main" function for a project.

  Description:
    This file contains the "main" function for a project.  The
    "main" function calls the "SYS_Initialize" function to initialize the state
    machines of all modules in the system
 *******************************************************************************/

// *****************************************************************************
// *****************************************************************************
// Section: Included Files
// *****************************************************************************
// *****************************************************************************

#include <stddef.h>                     // Defines NULL
#include <stdbool.h>                    // Defines true
#include <stdlib.h>                     // Defines EXIT_FAILURE
#include "definitions.h"                // SYS function prototypes

#include "rtthread.h"
#include "rtdevice.h"

#define LED_PIN_NUM    62

int main ( void )
{
    static int pin_num;
    /* Initialize all modules */
    //APP_Initialize();
    pin_num = LED_PIN_NUM;

    /* 设置PIN脚模式为输出 */
    rt_pin_mode (pin_num, PIN_MODE_OUTPUT);

    while ( true ) {
        //rt_thread_mdelay (500);
        //LED_Toggle();
        /* 拉低PIN脚 */
        rt_pin_write (pin_num, PIN_LOW);
        //rt_kprintf("led on!\r\n");
        /* 延时1000ms */
        rt_thread_mdelay (500);
        /* 拉高PIN脚 */
        rt_pin_write (pin_num, PIN_HIGH);
        //rt_kprintf("led off!\r\n");
        rt_thread_mdelay (500);
    }

    //return 0;
}

/*******************************************************************************
 End of File
*/

